package com.dzl.order.dao;

import com.dzl.base.mapper.BaseMapper;
import com.dzl.order.pojo.WelfareOrderGoods;
import com.dzl.order.pojo.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单商品表(WelfareOrderGoods)表数据库访问层
 * @author ChenLong
 * @date 2021-05-24 14:26:49
 */
@Repository
public interface WelfareOrderGoodsMapper extends BaseMapper<WelfareOrderGoods> {


    /**
     * 查询订单的商品明细
     * @date 2021/9/22 11:15
     * @author caobucao
     * @param orderId 订单id
     * @return java.util.List<com.dzl.order.pojo.vo.WelfareOrderGoodsVo>
     */
    List<WelfareOrderGoodsVo> selectOrderGoodsVoByOrderId(@Param("orderId") Integer orderId);

    /**
     * 通过订单id获取订单的卡支付明细
     * @param orderId 订单id
     * @return java.util.List<com.dzl.order.pojo.vo.OrderPayCardVo>
     * @date 2021/5/28 14:39
     * @author caobucao
     */
    List<OrderPayCardVo> selectOrderPayCarVo(@Param("orderId") Integer orderId);

    /**
     * 查询订单商品信息
     * @param orderId 订单id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-10 20:47:06
     **/
    List<WelfareOrderGoodsCardVo> getOrderGoodsByOrderId(@Param("orderId") Integer orderId);

    /**
     * 查询订单商品产品信息
     * @param orderId 订单id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-10 20:47:06
     **/
    WelfareOrderGoodsProductVo getOrderGoodsProductInfoByOrderId(@Param("orderId") Integer orderId);

    /**
     * 查询订单支付信息
     * @param orderId 订单id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-10 20:47:06
     **/
    List<WelfareOrderGoodsPayInfoVo> getPaymentCreditsInfo(@Param("orderId") Integer orderId);

    /**
     * 查询订单支付信息（通过拆单以后的订单号）
     * @param orderId 订单id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-10 20:47:06
     **/
    List<WelfareOrderGoodsPayInfoVo> getPaymentCreditsInfoForSplit(@Param("orderId") Integer orderId);

    /**
     * 查询订单支付信息
     * @param orderId 订单id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-10 20:47:06
     **/
    BigDecimal getPaymentCashInfo(@Param("orderId") Integer orderId);

    /**
     * 查询订单支付信息
     * @param orderId 订单id（通过拆单以后的订单号）
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-10 20:47:06
     **/
    BigDecimal getPaymentCashInfoForSplit(@Param("orderId") Integer orderId);

    /**
     * 获取支付过的订单商品列表（通过商品Id和卡维度）
     * @author ChenLong
     * @date 2021-08-20 10:15:26
     * @param cardSecretId 卡ID
     * @param goodsId 商品ID
     * @return java.util.List<com.dzl.order.pojo.WelfareOrderGoods>
     **/
    List<WelfareOrderGoods> getPaidOrderGoodsBySecretCardId(@Param("cardSecretId") Integer cardSecretId,@Param("goodsId") Integer goodsId);

    /**
     * 根据订单id查询订单商品ids
     * @param orderIds 多订单id
     * @author liuguanjun
     * @date 2021-10-14 14:15:06
     **/
    List<WelfareOrderGoods> selectOrderGoodsByOrderIds(@Param("orderIds") String orderIds);
}
